﻿using Catchbase.TestTools.UTest;
using Microsoft.Practices.Unity;
using WatiN.Core;

namespace Catchbase.Web.ATest
{
    public class IoC
    {
        private static IUnityContainer _container;

        public static IUnityContainer Container
        {
            get
            {
                if (_container == null) Initialize();
                return _container;
            }
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
        private static void Initialize()
        {
            _container = new UnityContainer();
            _container.RegisterType<SecretSettings>(new ContainerControlledLifetimeManager(), new InjectionConstructor("C:\\p.txt"));
            _container.RegisterType<Browser, IE>(new ContainerControlledLifetimeManager(), new InjectionConstructor(new object[] { }));
            
        } 
    }
}